;/*=============================================================================
;#    The element-comm is a tentative program used to test our ideas.           
;#                       Copyright (C)  bgao                                    
;#
;#     This program is free software; you can redistribute it and/or            
;#      modify it under the terms of the GNU General Public License             
;#     as published by the Free Software Foundation; either version 2           
;#         of the License, or (at your option) any later version.               
;#
;#     This program is distributed in the hope that it will be useful,          
;#    but WITHOUT ANY WARRANTY; without even the implied warranty of           
;#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            
;#             GNU General Public License for more details.                    
;#
;#    You should have received a copy of the GNU General Public License        
;#     along with this program; if not, write to the Free Software             
;#      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,             
;#                       MA  02110-1301, USA.                                  
;#==============================================================================
;# $Id$ 
;#
;# $Author$ 
;#
;# $Revision$ 
;#
;# $Date$ 
;#
;# Description: 
;#
;=============================================================================*/
;Start address of each stacks,
_STACK_BASEADDRESS	EQU		0x33ff8000  
_ISR_STARTADDRESS	EQU		0x33ffff00

BIT_SELFREFRESH EQU	(1<<22)

;Pre-defined constants
USERMODE    EQU 	0x10
FIQMODE     EQU 	0x11
IRQMODE     EQU 	0x12
SVCMODE     EQU 	0x13
ABORTMODE   EQU 	0x17
UNDEFMODE   EQU 	0x1b
MODEMASK    EQU 	0x1f
NOINT       EQU 	0xc0

;The location of vector table
KERNEL_BASE	EQU		0x30008000
VECTOR_TBALE_BASE EQU 0X00000000

;The location of stacks
UserStack	EQU	(_STACK_BASEADDRESS-0x3800)	;0x33ff4800 ~ 
SVCStack	EQU	(_STACK_BASEADDRESS-0x2800) ;0x33ff5800 ~
UndefStack	EQU	(_STACK_BASEADDRESS-0x2400) ;0x33ff5c00 ~
AbortStack	EQU	(_STACK_BASEADDRESS-0x2000) ;0x33ff6000 ~
IRQStack	EQU	(_STACK_BASEADDRESS-0x1000)	;0x33ff7000 ~
FIQStack	EQU	(_STACK_BASEADDRESS-0x0)	;0x33ff8000 ~ 


	GBLL 	PLL_ON_START  
PLL_ON_START	SETL 	{TRUE}


	GBLL	ENDIAN_CHANGE
ENDIAN_CHANGE	SETL	{FALSE}

	GBLA	ENTRY_BUS_WIDTH
ENTRY_BUS_WIDTH	SETA	16	


;BUSWIDTH = 16,32
	GBLA    BUSWIDTH	;max. bus width for the GPIO configuration
BUSWIDTH	SETA    32


	GBLA	FCLK
FCLK		SETA	200000000

    [	FCLK = 200000000
M_MDIV	EQU	0x5c	;Fin=12.0MHz Fout=200.0MHz
M_PDIV	EQU	0x4
M_SDIV	EQU	0x0
	]
	
M_HDIVN EQU	1	; HCLK is same as FCLK/2
M_PDIVN EQU	1	; PCLK is same as HCLK/2    

	END
